let data1={
    msg:{name:"刘济泽",id:1903010325,class:"19应用3-3班"},
    ImgColor:["#8A2BE2","#4169E1","#FFB6C1","#7FFFAA"],
    ImgSrc:["img/img1.jpg","img/img2.jpg","img/img3.jpg","img/img4.jpg"]
};

/*
let c = document.querySelectorAll("#div2 div")
c[0].style.background=data1.ImgColor[0]
c[1].style.background=data1.ImgColor[1]
c[2].style.background=data1.ImgColor[2]
c[3].style.background=data1.ImgColor[3]
*/

//此处开始用for循环写入：
let c = document.querySelectorAll("#div2 div")
let l=0
for (let i in data1.ImgColor){
    c[l].style.background=data1.ImgColor[i]
    l+=1
    }


